/**
 * Created by sunday on 2017/5/30.
 */
import java.net.*;
public class ShowIP
{
    public static void main(String[] args)
    {
        try
        {
            if(args.length > 0)
            {
                String hostName = args[0]; //主机名
                InetAddress[] addr = InetAddress.getAllByName(hostName);
                //得到该主机的所有地址
                //打印输出至控制台
                for(InetAddress address : addr)
                {
                    System.out.println(address.getHostAddress());
                }
            }
            else
            {
                System.out.println(InetAddress.getLocalHost().getHostAddress());
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}